#define _CRT_SECURE_NO_WARNINGS 1

#include "RBTree.h"
#include <vector>

void TestRBTree1()
{
	int a[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	RBTree<int, int> t;
	for (auto e : a)
	{
		t.Insert(make_pair(e, e));
	}
	cout  << t.IsBalance() << endl;
	cout << "Height" << t.Height() << endl;
}

void TestRBTree2()
{
	const int N = 1000000;
	vector<int> v;
	v.reserve(N);
	srand(time(0));

	for (size_t i = 0; i < N; i++)
	{
		v.push_back(rand()+i);
	}
	RBTree<int, int> t;
	for (auto e : v)
	{
		t.Insert(make_pair(e, e));
	}
	cout << t.Height();
}

int main()
{
	TestRBTree2();
	return 0;
}